package chapter_21_observer.mytest;

import java.util.Observable;
import java.util.Observer;

/**
 * Created by yao on 2016/11/18.
 * 观察者类
 * 如果被观察者类有更新，则观察者类要做update操作
 */
public class Watcher implements Observer {

    @Override
    public void update(Observable o, Object arg) {
        System.out.println("Watcher update "+((Watched)o).getAge());
    }
}
